-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
- name: Get fixtures | ||
run: cd .. && git clone https://github.com/nationalarchives/tna-frontend.git | ||
- name: Install Python requirements | ||
run: poetry install | ||
- name: Install Node dependencies | ||
run: cd tasks && npm install | ||
- name: Run server | ||
run: poetry run flask --app tna-frontend-jinja run --debug --port 5000 & | ||
- name: Run the tests | ||
run: node ./tasks/test.mjs || exit 1 | ||
|
||
deploy: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased](https://github.com/nationalarchives/tna-frontend-jinja/compare/v0.1.1...HEAD) | ||
|
||
### Added | ||
### Changed | ||
### Deprecated | ||
### Removed | ||
### Fixed | ||
### Security | ||
|
||
## [0.1.1](https://github.com/nationalarchives/tna-frontend-jinja/compare/v0.1.0...v0.1.1) - 2023-11-28 | ||
|
||
### Changed | ||
|
||
- Package structure updated | ||
|
||
## 0.1.0 - 2023-11-28 | ||
|
||
Initial release made to PyPi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from flask import Blueprint | ||
|
||
bp = Blueprint("components", __name__) | ||
bp = Blueprint( | ||
"components", __name__, template_folder="test-templates" | ||
) | ||
|
||
from app.components import routes # noqa: E402,F401 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/breadcrumbs/macro.html" import tnaBreadcrumbs -%} | ||
{{ tnaBreadcrumbs(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/button/macro.html" import tnaButton -%} | ||
{{ tnaButton(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/card/macro.html" import tnaCard -%} | ||
{{ tnaCard(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/cookie-banner/macro.html" import tnaCookieBanner -%} | ||
{{ tnaCookieBanner(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/filters/macro.html" import tnaFilters -%} | ||
{{ tnaFilters(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/footer/macro.html" import tnaFooter -%} | ||
{{ tnaFooter(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/grid/macro.html" import tnaGrid -%} | ||
{{ tnaGrid(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/header/macro.html" import tnaHeader -%} | ||
{{ tnaHeader(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/hero/macro.html" import tnaHero -%} | ||
{{ tnaHero(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/index-grid/macro.html" import tnaIndexGrid -%} | ||
{{ tnaIndexGrid(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/message/macro.html" import tnaMessage -%} | ||
{{ tnaMessage(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/phase-banner/macro.html" import tnaPhaseBanner -%} | ||
{{ tnaPhaseBanner(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/picture/macro.html" import tnaPicture -%} | ||
{{ tnaPicture(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/sensitive-image/macro.html" import tnaSensitiveImage -%} | ||
{{ tnaSensitiveImage(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/skip-link/macro.html" import tnaSkipLink -%} | ||
{{ tnaSkipLink(context) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{%- from "components/tabs/macro.html" import tnaTabs -%} | ||
{{ tnaTabs(context) }} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[tool.poetry] | ||
name = "tna-frontend-jinja" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
description = "" | ||
authors = ["Andrew Hosgood <[email protected]>"] | ||
readme = "README.md" | ||
packages = [{include = "app"}] | ||
packages = [{include = "templates"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{% from "components/cookie-banner/macro.html" import tnaCookieBanner -%} | ||
{% from "components/footer/macro.html" import tnaFooter -%} | ||
{% from "components/header/macro.html" import tnaHeader -%} | ||
{% from "components/skip-link/macro.html" import tnaSkipLink -%} | ||
<!DOCTYPE html> | ||
<html lang="{{ htmlLang | default('en-GB') }}" class="tna-template tna-template--{{ theme | default('system') }}-theme tna-template--{{ themeAccent | default('black') }}-accent {{ htmlClasses }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{% block pageTitle %}The National Archives{% endblock %}</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> | ||
<meta name="theme-color" content="{{ themeColor | default('#000000') }}"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
|
||
{% block headIcons %} | ||
<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="{{ assetPath | default('/assets') }}/images/favicon.ico" type="image/x-icon"> | ||
<link rel="mask-icon" href="{{ assetPath | default('/assets') }}/images/mask-icon.svg" color="{{ themeColor | default('#000000') }}"> | ||
<link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon-180x180.png"> | ||
<link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon-167x167.png"> | ||
<link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon-152x152.png"> | ||
<link rel="apple-touch-icon" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon.png"> | ||
{% endblock %} | ||
|
||
{% block head %}{% endblock %} | ||
|
||
{% block stylesheets %} | ||
<link rel="stylesheet" type="text/css" href="{{ tnaFrontendCssPath | default('/static/tna-frontend') }}/all.css"> | ||
<link rel="stylesheet" type="text/css" href="https://use.typekit.net/hkj3kuz.css"> | ||
{% endblock %} | ||
</head> | ||
<body class="tna-template__body {{ bodyClasses }}" {%- for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}> | ||
{% block bodyStart %} | ||
{% block cookies %} | ||
{{ tnaCookieBanner({ | ||
url: '#' | ||
}) }} | ||
{% endblock %} | ||
|
||
{% block skipLink %} | ||
{{ tnaSkipLink({ | ||
href: 'main-content', | ||
text: 'Skip to main content' | ||
}) }} | ||
{% endblock %} | ||
{% endblock %} | ||
|
||
{% block header %} | ||
{{ tnaHeader({}) }} | ||
{% endblock %} | ||
|
||
{% block main %} | ||
{% block beforeContent %}{% endblock %} | ||
<main class="tna-main-wrapper {{ mainClasses }}" id="main-content" role="main"> | ||
{% block content %}{% endblock %} | ||
</main> | ||
{% block afterContent %}{% endblock %} | ||
{% endblock %} | ||
|
||
{% block footer %} | ||
{{ tnaFooter({}) }} | ||
{% endblock %} | ||
|
||
{% block bodyEnd %} | ||
<script src="{{ tnaFrontendJsPath | default('/static/tna-frontend') }}/all.js"></script> | ||
<script> | ||
if (window.TNAFrontend && window.TNAFrontend.initAll) { | ||
document.addEventListener("DOMContentLoaded", function() { | ||
window.TNAFrontend.initAll(); | ||
}); | ||
} | ||
</script> | ||
{% endblock %} | ||
</body> | ||
</html> |