semvec/pypi-packages huggingface dataset:
lektor-google-search 0.1
Lektor plugin to add google seach to a website
License: MIT
Keywords: Lektor plugin

# Lektor-Google-Search

This plugin add support for [Google Search](https://search.google.com/search-console/about) to [Lektor CMS](https://www.getlektor.com/)

Once the plugin is enabled, a `render_google_search()` function is available to be included in a taget `template` which autoatically
include Google-Search code in final HTML fles rendered by Lektor.

## How to Use the plugin ?

### Enable the plugin

To enable the plugin, add the following to your `.lektorproject` file:

```ini
[packages]
lektor-google-search = 0.1
```

### Configure the plugin

The plugin needs a config file with your `search Engine ID` code in it

- Create a file named `google-serch.ini` into `./configs` folder in your lektor project's base directory.
- Put the `SEARCH_ENGINE_ID` key with the value of your serch engine ID.

```ini
SEARCH_ENGINE_ID = 83892839209432084
```

### Usage in template

Add Google Search code snippet by calling the function `render_google_search()` in the template of your preference where you want the search box to appear.

```html
<div>{{ render_googe_search() }}</div>
```

Now, try to run `lektor server` to see the google search appear.
resolve-name-clash 0.1.3
Simple utility that takes a source file and a destination directory and determines a unique name for the source file in the destination directory that will not clash with any existing file.
License: MIT
Requires Python: >=3.9,<4.0

# resolve-name-clash

Say you want to copy file `a.txt` into directory `/path/to/destination/` but if `/path/to/destination/a.txt` exists, you don't want to overwrite it but instead copy the file to `/path/to/destination/a_1.txt`. This is a simple utility that does exactly one thing: given a source filename and a destination directory, it figures out a form of the source file's name in the destination directory that doesn't clash with any existing file. 

The algorithm it uses to find a unique filename is as follows. Given a path to a source file and a path to a destination directory:
* Set `src_filename` to the filename (last path segment) of the path to the source file
* If `path/to/dest/src_filename` does not exist, return it
* If `path/to/dest/src_filename` exists:
  * Set `src_file_basename` to `src_filename` with all the extensions removed and `src_file_extensions` to all the extensions of `src_filename`
  * Successively try `path/to/dest/src_file_basename + "_1" + src_file_extensions`, `path/to/dest/src_file_basename + "_2" + src_file_extensions`, and so on until one is found that doesn't exist. Return that one.

You can use it on the command line: 
```
$ resolve-name-clash ~/src/a.txt ~/dest/
/Users/spather/dest/a_1.txt
```

It's particularly useful used in a subshell with a copy or move command:
```
cp ~/src/a.txt $(resolve-name-clash ~/src/a.txt ~/dest)
```

Or you can us it in a python program:

```python
from resolve_name_clash import resolve_name_clash

src = Path("/path/to/src/a.txt")
dest = Path("/path/to/dest")
unique_path = resolve_name_clash(src, dest)
# unique_path will be a Path object to something like /path/to/dest/a_1.txt
```