Giter Site home page Giter Site logo

venthur / blag Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 7.0 459 KB

blag is a blog-aware, static site generator -- it uses Markdown and is written in Python.

Home Page: https://blag.readthedocs.io

License: MIT License

Makefile 2.43% Python 73.39% HTML 6.40% CSS 17.78%
blag debian jinja2 markdown pygments python static-site-generator

blag's Introduction

I'm Bastian Venthur, a software developer with a passion for free and open source software. In my free time, I contribute to the Debian project as a Debian Developer and work on various Free Software Projects. Professionally, I'm DTO at Flix.

blag's People

Contributors

debian-janitor avatar dependabot[bot] avatar venthur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blag's Issues

Create a nice minimal default theme

The default theme is un-styled and does not look very pleasing. We should add a nice minimal style that looks decent out of the box. It should come with a light- and a dark theme and corresponding pygments styles.

XMPP: Post to PubSub nodes

Greetings!

In XMPP, using PubSub(1) (XEP-0060), it is possible to store posts as Atom Syndication(2) entries into XMPP(3).

There are several XMPP extensions that apply it, namely XEP-0227 (4) and XEP-0472 (5) which make node xmpp:microblog:0 as a common choice to manage news for client accounts (e.g. [email protected]), yet a component account (e.g. pubsub.website.net) may use all of its nodes for this purpose.

pubsub.website.net/
|
|-- updates/
    |-- Sombre
     `-- Varied
|-- releases/
 `-- events/
pubsub service/
|
|-- node/
    |-- item
     `-- item
|-- node/
 `-- node/

I have made a script that realizes viewing PubSub node items as Atom XML feeds over HTTP.

  1. XEP-0060: Publish-Subscribe
  2. RFC 4287: The Atom Syndication Format
  3. Atom Over XMPP
  4. XEP-0277: Microblogging over XMPP
  5. XEP-0472: Pubsub Social Feed
  6. PubSub Over HTTP

emacs noise files make "blag serve" very noisy

When using blag serve with content I'm editing with emacs, it gets tripped up by the .foo# symlink-lock-tags. The try/except covers it but generates a lot of rapid fire noise in the log output:

2024-07-14 18:03:42,220 ERROR blag.devserver Error occurred during rebuild:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/blag/devserver.py", line 80, in autoreload
    mtime = get_last_modified(dirs)
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/blag/devserver.py", line 45, in get_last_modified
    mtime = os.stat(os.path.join(root, f)).st_mtime
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'content/.#survey.md'
2024-07-14 18:03:42,221 INFO blag.devserver Devserver did not crash, you may continue editing.

(The link is of the form .#survey.md -> [email protected]:1720912332 which doesn't exist, it's just being used because symlink creation is sufficiently atomic.)

On the theory that

  • it makes sense to obey the convention that dotfiles are hidden, and skip them
  • emacs is common enough that ignoring backup files ending in ~ makes sense too
diff --git a/blag/blag.py b/blag/blag.py
index ed6db15..c538a5c 100644
--- a/blag/blag.py
+++ b/blag/blag.py
@@ -217,6 +217,9 @@ def build(args: argparse.Namespace) -> None:
     convertibles = []
     for root, dirnames, filenames in os.walk(args.input_dir):
         for filename in filenames:
+            if filename.startswith(".") or filename.endswith("~"):
+                logger.debug(f"Skipping {filename}...")
+                continue
             rel_src = os.path.relpath(
                 f"{root}/{filename}", start=args.input_dir
             )
diff --git a/blag/devserver.py b/blag/devserver.py
index 1945740..076b7f9 100644
--- a/blag/devserver.py
+++ b/blag/devserver.py
@@ -42,6 +42,9 @@ def get_last_modified(dirs: list[str]) -> float:
     for dir in dirs:
         for root, dirs, files in os.walk(dir):
             for f in files:
+                if f.startswith(".") or f.endswith("~"):
+                    logger.debug(f"Skipping {f} ...")
+                    continue
                 mtime = os.stat(os.path.join(root, f)).st_mtime
                 if mtime > last_mtime:
                     last_mtime = mtime

worked for me.

Footnote in markdown files

hello,

thanks a lot for your service.

I test it. I use a lot of footnotes and there are not render in html file. do you know why ?
is this correct ?

Quasi nobis adipisci similique est molestiae[^f] omnis sequi. Doloribus sed exercitationem 
et sed dicta. Eveniet aliquam et et voluptatem ut sunt doloremque rerum.

[^f]: Footnote content

thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.