Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
The lamyà package provides both an out of the box markdown static site generator and a framework for building your own custom ones.
The lamya
(emphasis is on the ya - lamyà) package provides both an out of the box markdown static site generator and a framework for building your own custom ones.
I like to think of it as a static site generator generator.
To install lamya
you can use pip:
pip install lamya[all]
The reason I've added the optional all
dependencies is that by default lamya
attempts to use markdown
as a markup processor and jinja2
as a template engine, but if you know you will be using a different markup processor and template engine you are free to skip the [all]
and just install lamya
.
You can run lamya
's static site generator as a module to turn a directory of markdown files into a static site:
python -m lamya -url "http://my_url.com" --content_directory "path_to_content/" [OPTIONS]
This will take all the markdown descendants of the path_to_content
directory and turn them into a static site, built into a folder called build
in the current directory.
NOTE: If no --content_directory
flag is provided, ./content
will be used. Additionally the --build_directory
flag can be used to specify where to build the site. For more info about flags have a look at the full CLI Reference.
Or you could write a simple build script which uses the lamya.site_generator.SiteGenerator
like so:
from lamya.site_generator import SiteGenerator
from pathlib import Path
site_gen = SiteGenerator(name="dontpanic", url="https://dont.panic",
subtitle="we demand rigidly defined areas of doubt and uncertainty",
theme_options={"sidebar":True, "sidebar_image":"/img/sidebar.png"},
content_directory=Path("content"))
# Make sure all content has been read and any front matter information has been
# extracted, so it can be used in the templates
site_gen.process_content_tree()
# optionally modify your existing content, generate new one, categorize
# posts, etc.
# optionally build a navigation
site_gen.build_navigation()
# or you could manually provide one
# site_gen.navigation = {}
# generate the site
site_gen.render()
Alternatively, if you like the idea of mostly maintaining one Config object, which specifies most of your build process, you can utilize the same function that generates the site via the CLI method above - lamya.site_generator.SiteGenerator.run_from_config()
.
from lamya.config import Config as DefaultConfig
from lamya.site_generator import SiteGenerator
class Config(DefaultConfig):
name = "dontpanic"
url = "https://dont.panic"
subtitle="we demand rigidly defined areas of doubt and uncertainty",
content_directory="content",
theme_options = {
"sidebar": True,
"sidebar_image": "/img/sidebar.png"
}
site_gen = SiteGenerator.run_from_config(Config(), render=False)
# We've set `render` to False above, so we can make any changes we'd like
# here before actually rendering the site
# NOTE: That this method is more similar to the CLI method above, since
# all of the functions like `process_content_tree`, `build_navigation`, etc.
# are called inside the `run_from_config`.
site_gen.render()
Or here's a link to the full documentation.
This project is licensed under the GNU General Public License v3.0
FAQs
The lamyà package provides both an out of the box markdown static site generator and a framework for building your own custom ones.
We found that lamya demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.