-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new template for legacy blog/newsroom items #8484
Open
csebianlander
wants to merge
16
commits into
main
Choose a base branch
from
legacy-page-template
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
696f6a1
Create new template for legacy blog/newsroom items
csebianlander fa231af
Newsroom reference fix, initial templating
csebianlander a9fe4db
Merge branch 'main' into legacy-page-template
csebianlander 4932e09
Add banner template
anselmbradford dab3f24
Remove unneeded line from FIG
anselmbradford 00ab884
Merge branch 'main' into legacy-page-template
csebianlander 8625171
Merge branch 'main' into legacy-page-template
csebianlander 668ce01
Merge branch 'main' into legacy-page-template
willbarton 9c0c14b
Adding Archive-It collection ID
csebianlander ecc891b
Merge branch 'main' into legacy-page-template
csebianlander 984cf38
Adding timestamp to A-I URL path
csebianlander 1ae464d
Merge branch 'main' into legacy-page-template
csebianlander d891e31
Update cfgov/v1/jinja2/v1/includes/molecules/banner.html
csebianlander 5d982a0
Update cfgov/v1/jinja2/v1/includes/organisms/header.html
csebianlander f75d8f2
Update cfgov/v1/jinja2/v1/includes/molecules/banner.html
csebianlander fd003dc
Update cfgov/v1/jinja2/v1/includes/molecules/banner.html
csebianlander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% extends 'v1/layouts/layout-2-1.html' %} | ||
|
||
{% import 'v1/includes/templates/streamfield-sidefoot.html' as streamfield_sidefoot with context %} | ||
|
||
{% block og_type -%} | ||
article | ||
{%- endblock %} | ||
|
||
{% block og_article_prefix -%} | ||
article: http://ogp.me/ns/article# | ||
{%- endblock %} | ||
|
||
{% block og_article_author -%} | ||
<meta property="article:author" | ||
content="{{ _( 'https://www.facebook.com/CFPB' ) }}"> | ||
{%- endblock %} | ||
|
||
{% block content_intro scoped -%} | ||
{% import 'v1/includes/molecules/banner.html' as banner %} | ||
{% set canonical_archive_url = 'https://wayback.archive-it.org/23462/20241001120000/' ~ request.build_absolute_uri(request.path) | lower %} | ||
{{- banner.render( | ||
true, | ||
'Archived content', | ||
'This content has been archived, and its original formatting has been removed.', | ||
[ { | ||
'text': 'View this page as it was originally published', | ||
'url': canonical_archive_url | ||
} ] | ||
) }} | ||
{%- endblock %} | ||
|
||
{% block content_main %} | ||
|
||
{% include 'v1/includes/article.html' %} | ||
{% block post_article_content %} | ||
|
||
{% endblock %} | ||
{% endblock %} | ||
|
||
{% block content_sidebar %} | ||
{{ streamfield_sidefoot.render(page.sidefoot) }} | ||
{% if rss_feed %} | ||
<div class="block"> | ||
{% import 'v1/includes/molecules/rss-feed.html' as rss %} | ||
{{ rss.render(rss_feed) }} | ||
</div> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{# ========================================================================== | ||
|
||
banner.render() | ||
|
||
========================================================================== | ||
|
||
Description: | ||
|
||
Builds banner markup when given: | ||
|
||
is_dark: Whether the banner is dark or not. Default is false. | ||
|
||
message: Text to display within the banner's notification markup. | ||
|
||
explanation: Text to display as an explanation | ||
within the banner's notification markup. | ||
Defaults to none. | ||
|
||
links: Array of link objects, which each contain: | ||
- text (required): text of link. | ||
- url: link url. | ||
- is_link_boldface: sets bold formatting. | ||
- open_link_in_new_window: opens the link in a new window | ||
Defaults to an empty array. | ||
|
||
========================================================================== #} | ||
|
||
{% macro render(is_dark, message, explanation, links) %} | ||
<div class="o-banner{{ ' o-banner--dark' if is_dark else '' }}"> | ||
<div class="wrapper wrapper--match-content"> | ||
{% import 'v1/includes/molecules/notification.html' as notification %} | ||
{{ notification.render( | ||
'warning', | ||
true, | ||
message, | ||
explanation, | ||
links | ||
) }} | ||
</div> | ||
</div> | ||
{% endmacro %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of inheriting this from layout-2-1, would it make more sense to extend from blog_page.html, and only overwrite the
content_intro
andcontent_main
blocks? This would avoid having to redefine all of the other blocks that just duplicate what's in blog_page.