~magentix/stapy-theme-dusk

657c8169da2542363663fc414ce2780e66f7913f — magentix 1 year, 6 months ago cfa9bda 1.3.0
Adapted to last Stapy release
M .gitignore => .gitignore +10 -1
@@ 1,4 1,13 @@
**/__pycache__
venv
tests
web
build.py
stapy.py
\ No newline at end of file
stapy.py
plugins/cache.py
plugins/cssmin.py
plugins/date.py
plugins/editor.py
plugins/htmltidy.py
plugins/menu.py
plugins/pages.py
\ No newline at end of file

R source/assets/media/wave.jpg => source/assets/media/blog/1684013781-wave.jpg +0 -0
A source/assets/media/blog/1684013789-wave.jpg => source/assets/media/blog/1684013789-wave.jpg +0 -0
A source/assets/media/blog/1684013796-wave.jpg => source/assets/media/blog/1684013796-wave.jpg +0 -0
M source/content/articles.html => source/content/articles.html +1 -1
@@ 1,3 1,3 @@
<h2>Articles</h2>

{% block.article ~ tags:post date:desc 1:100 %}
\ No newline at end of file
{% block.article ~ SELECT ITEMS WHERE "post" in tags ORDER BY date desc %}
\ No newline at end of file

R source/content/blog/article.html => source/content/blog/article-1.html +0 -17
@@ 1,21 1,4 @@
<p>
    <a href="{{ url }}articles.html">Articles</a> : {{ title }}
</p>

<h2>{{ title }}</h2>

<article>
    <p>
        <em>{{ date }} by {{ author }}</em>
    </p>
    <p>
        {{ intro }}
    </p>
</article>

<img src="{{ url }}media/wave.jpg" alt="Wave" width="800" height="249" />

<p>
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>

A source/content/blog/article-2.html => source/content/blog/article-2.html +15 -0
@@ 0,0 1,15 @@
<p>
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
    Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
</p>
<p>
    Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
</p>
<p>
    Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
</p>
<p>
    Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
</p>
\ No newline at end of file

A source/content/blog/article-3.html => source/content/blog/article-3.html +15 -0
@@ 0,0 1,15 @@
<p>
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
    Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
</p>
<p>
    Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
</p>
<p>
    Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
</p>
<p>
    Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
</p>
\ No newline at end of file

M source/content/index.html => source/content/index.html +1 -1
@@ 61,7 61,7 @@
</table>

<blockquote>
    The Web is more a social creation than a technical one. I designed it for a social effect—to help people work together—and not as a technical toy.<br />
    The Web is more a social creation than a technical one. I designed it for a social effect���to help people work together���and not as a technical toy.<br />
    <br />
    Tim Berners-Lee
</blockquote>

R source/template/robots.txt => source/content/robots.txt +0 -0
A source/content/rss.xml => source/content/rss.xml +10 -0
@@ 0,0 1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="{{ url }}rss.xml" rel="self" type="application/rss+xml" />
    <title>{{ rss.title }}</title>
    <description>{{ rss.description }}</description>
    <link>{{ url }}</link>
    {% rss.item ~ SELECT ITEMS 1-10 WHERE "post" in tags ORDER BY date desc %}
  </channel>
</rss>

R source/template/sitemap.xml => source/content/sitemap.xml +1 -1
@@ 1,4 1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% page_url ~ tags:sitemap date:desc 1:10000 %}
{% page_url ~ SELECT ITEMS WHERE "sitemap" in tags ORDER BY date desc %}
</urlset>
\ No newline at end of file

A source/editor.json => source/editor.json +385 -0
@@ 0,0 1,385 @@
{
  "_editor": {
    "protected_pages": [
      "robots.txt",
      "sitemap.xml"
    ],
    "editor_switcher": {
      "Full": "/_editor",
      "Content": "/_editor_c"
    },
    "grid": {
      "actions": [
        {
          "path": "build/",
          "class": "button-secondary pure-button",
          "label": "Build"
        },
        {
          "path": "add/",
          "class": "pure-button pure-button-primary",
          "label": "Add",
          "data": {
            "cy": "add"
          }
        }
      ],
      "columns": {
        "title": {
          "label": "Title"
        },
        "date": {
          "label": "Date"
        },
        "enabled": {
          "label": "Enabled",
          "options": [
            {
                "values": ["", "1", 1, true],
                "label": "Yes"
            },
            {
                "values": ["0", 0, false],
                "label": "No"
            }
          ]
        }
      },
      "query": "SELECT ITEMS ORDER BY date desc"
    },
    "form": {
      "actions": {
        "back": true,
        "reset": true,
        "data": true,
        "view": true,
        "delete": true,
        "save": true
      },
      "fieldsets": [
        {
          "label": "General",
          "column": "left",
          "fields": {
            "_full_path": {
              "label": "Page path",
              "required": true,
              "save": false
            },
            "_page_type": {
              "label": "Page type",
              "required": true,
              "save": false,
              "type": "select",
              "options": [
                {
                  "value": "html",
                  "label": "HTML"
                },
                {
                  "value": "txt",
                  "label": "Text"
                },
                {
                  "value": "md",
                  "label": "Markdown"
                },
                {
                  "value": "xml",
                  "label": "XML"
                },
                {
                  "value": "json",
                  "label": "JSON"
                },
                {
                  "value": "css",
                  "label": "CSS"
                },
                {
                  "value": "js",
                  "label": "Javascript"
                }
              ]
            },
            "enabled": {
              "label": "Enabled",
              "required": true,
              "type": "select",
              "options": [
                {
                    "value": 1,
                    "label": "Yes"
                },
                {
                    "value": 0,
                    "label": "No"
                }
              ]
            },
            "title": {
              "label": "Title",
              "required": true
            },
            "tags": {
              "label": "Tags",
              "type": "multiselect",
              "options": [
                {
                  "value": "post",
                  "label": "Post"
                },
                {
                  "value": "sitemap",
                  "label": "Sitemap"
                },
                {
                  "value": "menu",
                  "label": "Menu"
                }
              ]
            }
          }
        },
        {
          "label": "SEO",
          "column": "left",
          "depends": [
            {
              "field": "_page_type",
              "values": ["html"]
            }
          ],
          "fields": {
            "meta_title": {
              "label": "Meta Title"
            },
            "meta_description": {
              "label": "Meta Description"
            },
            "robots": {
              "label": "Robots",
              "required": true,
              "type": "select",
              "options": [
                {
                  "value": "index,follow",
                  "label": "index,follow"
                },
                {
                  "value": "noindex,nofollow",
                  "label": "noindex,nofollow"
                },
                {
                  "value": "index,nofollow",
                  "label": "index,nofollow"
                },
                {
                  "value": "noindex,follow",
                  "label": "noindex,follow"
                }
              ]
            }
          }
        },
        {
          "label": "Blog Post",
          "column": "left",
          "depends": [
            {
              "field": "_page_type",
              "values": ["html"]
            },
            {
              "field": "tags",
              "values": ["post"]
            }
          ],
          "fields": {
            "date": {
              "label": "Date",
              "required": true,
              "type": "date"
            },
            "author": {
              "label": "Author",
              "required": true
            },
            "intro": {
              "label": "Intro",
              "required": true
            },
            "picture": {
              "label": "Picture",
              "type": "image",
              "directory": "media/blog",
              "extensions": ["png", "jpg", "jpeg", "gif", "webp"]
            }
          }
        },
        {
          "label": "RSS",
          "column": "left",
          "depends": [
            {
              "field": "_page_type",
              "values": ["xml"]
            },
            {
              "field": "_full_path",
              "values": ["rss.xml"]
            }
          ],
          "fields": {
            "rss.title": {
              "label": "Title",
              "required": true
            },
            "rss.description": {
              "label": "Description",
              "required": true
            }
          }
        },
        {
          "label": "Menu",
          "column": "left",
          "depends": [
            {
              "field": "_page_type",
              "values": ["html"]
            },
            {
              "field": "tags",
              "values": ["menu"]
            }
          ],
          "fields": {
            "menu.position": {
              "label": "Position in menu"
            }
          }
        },
        {
          "label": "Content",
          "column": "right",
          "fields": {
            "content": {
              "label": "Content",
              "type": "block",
              "mode": "$_page_type",
              "focus": true,
              "save_dir": "content"
            }
          }
        }
      ]
    }
  },
  "_editor_c": {
    "protected_pages": [
      "robots.txt",
      "sitemap.xml"
    ],
    "editor_switcher": {
      "Full": "/_editor",
      "Content": "/_editor_c"
    },
    "grid": {
      "columns": {
        "title": {
          "label": "Title"
        },
        "date": {
          "label": "Date"
        },
        "enabled": {
          "label": "Enabled",
          "options": [
            {
                "values": ["", "1", 1, true],
                "label": "Yes"
            },
            {
                "values": ["0", 0, false],
                "label": "No"
            }
          ]
        }
      },
      "query": "SELECT ITEMS ORDER BY date desc"
    },
    "form": {
      "actions": {
        "back": true,
        "reset": true,
        "data": true,
        "view": true,
        "delete": false,
        "save": true
      },
      "fieldsets": [
        {
          "label": "Content",
          "column": "right",
          "fields": {
            "_full_path": {
              "label": "Page path",
              "required": true,
              "save": false,
              "hide": true
            },
            "_page_type": {
              "label": "Page type",
              "required": true,
              "save": false,
              "hide": true,
              "type": "select",
              "options": [
                {
                  "value": "html",
                  "label": "HTML"
                },
                {
                  "value": "txt",
                  "label": "Text"
                },
                {
                  "value": "md",
                  "label": "Markdown"
                },
                {
                  "value": "xml",
                  "label": "XML"
                },
                {
                  "value": "json",
                  "label": "JSON"
                },
                {
                  "value": "css",
                  "label": "CSS"
                },
                {
                  "value": "js",
                  "label": "Javascript"
                }
              ]
            },
            "title": {
              "label": "Title",
              "readonly": true
            },
            "content": {
              "label": "Content",
              "type": "block",
              "mode": "$_page_type",
              "focus": true,
              "save_dir": "content"
            }
          }
        }
      ]
    }
  }
}
\ No newline at end of file

A source/layout/blog/html.json => source/layout/blog/html.json +3 -0
@@ 0,0 1,3 @@
{
  "template": "template/post.html"
}
\ No newline at end of file

M source/pages/404.html.json => source/pages/404.html.json +3 -2
@@ 1,7 1,8 @@
{
  "content": "content/404.html",

  "meta_title": "Page not found",
  "meta_description": "The requested URL was not found on this server",
  "robots": "noindex,nofollow"
  "robots": "noindex,nofollow",
  "enabled": "1",
  "title": "Page not found"
}
\ No newline at end of file

M source/pages/about.html.json => source/pages/about.html.json +6 -3
@@ 1,8 1,11 @@
{
  "content": "content/about.html",

  "meta_title": "Dusk - About",
  "meta_description": "A simple and minimal theme for Stapy",

  "tags": ["sitemap"]
  "tags": [
    "sitemap"
  ],
  "enabled": "1",
  "title": "About",
  "robots": "index,follow"
}
\ No newline at end of file

M source/pages/articles.html.json => source/pages/articles.html.json +6 -4
@@ 1,10 1,12 @@
{
  "content": "content/articles.html",

  "block.article": "template/block/article.html",

  "meta_title": "Dusk - Articles",
  "meta_description": "A simple and minimal theme for Stapy",

  "tags": ["sitemap"]
  "tags": [
    "sitemap"
  ],
  "enabled": "1",
  "title": "Articles",
  "robots": "index,follow"
}
\ No newline at end of file

M source/pages/blog/article-1.html.json => source/pages/blog/article-1.html.json +10 -6
@@ 1,12 1,16 @@
{
  "content": "content/blog/article.html",

  "meta_title": "Arctic - Article",
  "content": "content/blog/article-1.html",
  "meta_title": "Dusk - Article",
  "meta_description": "A simple and minimal theme for Stapy",
  "title": "At asperiores dolores hic molestias",
  "date": "2021-04-06",
  "date": "2022-04-06",
  "author": "Magentix",
  "intro": "Quo magnam mollitia ea odit amet. Eos iste itaque sed consequatur dolor ut saepe omnis sed maiores excepturi in voluptatem nihil.",

  "tags": ["post", "sitemap"]
  "tags": [
    "post",
    "sitemap"
  ],
  "enabled": "1",
  "robots": "index,follow",
  "picture": "media/blog/1684013781-wave.jpg"
}
\ No newline at end of file

M source/pages/blog/article-2.html.json => source/pages/blog/article-2.html.json +10 -6
@@ 1,12 1,16 @@
{
  "content": "content/blog/article.html",

  "meta_title": "Arctic - Article",
  "content": "content/blog/article-2.html",
  "meta_title": "Dusk - Article",
  "meta_description": "A simple and minimal theme for Stapy",
  "title": "Qui voluptates consequatur eos reprehenderit",
  "date": "2021-04-02",
  "date": "2022-04-02",
  "author": "Magentix",
  "intro": "Dolore qui aliquam eius aut voluptatem dolor. Eos molestias molestiae et quibusdam amet quo pariatur deleniti aut nostrum iure eos explicabo voluptate.",

  "tags": ["post", "sitemap"]
  "tags": [
    "post",
    "sitemap"
  ],
  "enabled": "1",
  "robots": "index,follow",
  "picture": "media/blog/1684013789-wave.jpg"
}
\ No newline at end of file

M source/pages/blog/article-3.html.json => source/pages/blog/article-3.html.json +10 -6
@@ 1,12 1,16 @@
{
  "content": "content/blog/article.html",

  "meta_title": "Arctic - Article",
  "content": "content/blog/article-3.html",
  "meta_title": "Dusk - Article",
  "meta_description": "A simple and minimal theme for Stapy",
  "title": "Lorem ipsum dolor sit amet",
  "date": "2021-03-26",
  "date": "2022-03-26",
  "author": "Magentix",
  "intro": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",

  "tags": ["post", "sitemap"]
  "tags": [
    "post",
    "sitemap"
  ],
  "enabled": "1",
  "robots": "index,follow",
  "picture": "media/blog/1684013796-wave.jpg"
}
\ No newline at end of file

M source/pages/index.html.json => source/pages/index.html.json +6 -3
@@ 1,8 1,11 @@
{
  "content": "content/index.html",

  "meta_title": "Dusk - Home",
  "meta_description": "A simple and minimal theme for Stapy",

  "tags": ["sitemap"]
  "tags": [
    "sitemap"
  ],
  "enabled": "1",
  "title": "Home",
  "robots": "index,follow"
}
\ No newline at end of file

M source/pages/robots.txt.json => source/pages/robots.txt.json +1 -2
@@ 1,5 1,4 @@
{
  "template": "template/robots.txt",

  "content": "content/robots.txt",
  "directive": "Allow: /"
}
\ No newline at end of file

A source/pages/rss.xml.json => source/pages/rss.xml.json +8 -0
@@ 0,0 1,8 @@
{
  "content": "content/rss.xml",
  "rss.item": "template/rss/item.xml",
  "rss.title": "Stapy",
  "rss.description": "John Doe, Software developer",
  "enabled": "1",
  "title": "RSS Feed"
}
\ No newline at end of file

M source/pages/sitemap.xml.json => source/pages/sitemap.xml.json +1 -2
@@ 1,5 1,4 @@
{
  "template": "template/sitemap.xml",
  
  "content": "content/sitemap.xml",
  "page_url": "template/sitemap/url.xml"
}
\ No newline at end of file

M source/template/block/article.html => source/template/block/article.html +1 -1
@@ 1,7 1,7 @@
<article>
    <p><a href="{{ url }}{{ $_path }}">{{ $title }}</a></p>
    <p>
        <em>{{ $date }} by {{ $author }}</em>
        <em>{{ $date_full }} by {{ $author }}</em>
    </p>
    <p>
        {{ $intro }}

A source/template/post.html => source/template/post.html +38 -0
@@ 0,0 1,38 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ lang }}" xml:lang="{{ lang }}">
    <head>
        {% block.head %}
    </head>
    <body>
        <header>
            <div id="header-content">
                {% block.header %}
            </div>
        </header>
        <main>
            <div id="main-content">
                <p>
                    <a href="{{ url }}articles.html">Articles</a> : {{ title }}
                </p>
                <h2>{{ title }}</h2>
                <article>
                    <p>
                        <em>{{ date_full }} by {{ author }}</em>
                    </p>
                    <p>
                        {{ intro }}
                    </p>
                </article>
                <div class="content">
                    <img src="{{ url }}{{ picture }}" alt="{{ title }}" width="800" />
                    {% content %}
                </div>
            </div>
        </main>
        <footer>
            <div id="footer-content">
                {% block.footer %}
            </div>
        </footer>
    </body>
</html>
\ No newline at end of file

A source/template/rss/item.xml => source/template/rss/item.xml +7 -0
@@ 0,0 1,7 @@
<item>
  <title>{{ $title }}</title>
  <pubDate>{{ $date_rfc_822 }}</pubDate>
  <link>{{ url }}{{ $_path }}</link>
  <guid>{{ url }}{{ $_path }}</guid>
  <description>{{ $intro }}</description>
</item>
\ No newline at end of file