The really, really minimalistic static site generator
Project description
The really, really minimalistic static site generator. Manage translations statically, without any pesky JavaScript for rendering dynamic chunks of localized text.
Features
Separate key phrases (or everything, for that matter) into “modals” and localized content files.
Create includes such as site-wide headers and footers to reduce repetition.
Avoid copy and pasting the same content several times with global translations.
Keep things simple with Mustache templates.
Extend Ampersand with plugins written in Python.
The problem
Traditionally, managing translations of a website statically would look something like this:
__ root | |__ scripts | |__ scripts.js | |__ styles | |__ styles.css | |__ lang |__ en | |__ index.html | |__ about.html | |__ ... | |__ fr |__ index.html |__ about.html |__ ...
Here, we have a website with two or more English pages that we also translated into French. This works, but what happens when I want to make some changes to index.html? Now, I need to copy those changes over to the fr folder and adapt. When these phrases are wrapped with new UI components, It gets worse the more languages you add.
The solution
A problem like this would take a static site generator to solve, but not just any static site generator would do the trick. This generator must have a focus on translation, allowing you to build several copies of the same page based on different localization files.
Now, you can leave the translation to the globalization team and focus on your code.
Philosophy
So as you can tell, Ampersand is a pretty straightforward static site generator. Some may even argue that it doesn’t do much. This is because Ampersand is a minimalistic static site generator. But of course, all static site generators mention minimalism in their mission statement so saying it here doesn’t mean much. Never the less, Ampersand aims to do what it’s supposed to do without jumping through too many hoops that don’t help it achieve its goal.
Installation
Setting up Ampersand is fairly simple if you have pip. For those of you who don’t, python.org has it documented.
$ pip install ampersand
For a bleeding edge and developer version, you can clone the repository:
$ git clone https://github.com/natejms/ampersand.git $ cd ampersand $ pip install .
To learn more about the usage of Ampersand, check out the documentation
Contributing
Interested in making a contribution? Here’s a few places where you might be able to help out:
Contribute patches and help develop new features
Develop a plugin for Ampersand
Work to improve the documentation
Help spread the word
More information can be found in the CONTRIBUTING.md file of this repository.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ampersand-0.5.2.tar.gz
.
File metadata
- Download URL: ampersand-0.5.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f08a9649305304a1299efd1f532cefd9e5d9adecd62db460c8864b515322e213 |
|
MD5 | 6a47db90f4f70af7fb0581d905415a48 |
|
BLAKE2b-256 | e719f6f8537d17ac90f8c8bacd7431b67be5ca28fefe0d53d7ccb0b596f69d17 |
File details
Details for the file ampersand-0.5.2-py2.py3-none-any.whl
.
File metadata
- Download URL: ampersand-0.5.2-py2.py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d384eb678a8695cb2220d33e00e868368ece083e936c22eb7bb41f32f7ce9fb |
|
MD5 | e14c02befcc8a727ffbbee0c03251dc1 |
|
BLAKE2b-256 | 4d7b66755d6dd3157eb764f2e14e680360c93647ebd9f5998232e8ff7e73b9f5 |