Skip to content
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

enhance: support template overwrite not inheritance #710

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions taccsite_cms/templates/assets_core.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
@import url("https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css") layer(foundation);
@import url("{% static 'site_cms/css/build/core-styles.base.css' %}") layer(base);
</style>

{% with settings.FAVICON as favicon %}
<link rel="icon" href="{% static favicon.img_file_src %}" type="image/x-icon" />
{% endwith %}
23 changes: 5 additions & 18 deletions taccsite_cms/templates/assets_custom.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
{% load static %}

{# Load assets as external files, to cache independently of markup. #}
{% comment %}
FAQ: IF a script or style is better cached with markup, THEN:
- Such a style belongs inline before relevant markup, not via this block
- Such a script belongs inline after relevant markup, not via this block
{% endcomment %}

{# NOTE: Fonts may be loaded early via `assets_font` #}



<!-- Custom Site Assets: Favicon. -->
{% with settings.FAVICON as favicon %}
<link rel="icon" href="{% static favicon.img_file_src %}" type="image/x-icon" />
{% endwith %}



{# Do NOT directly load project-specific assets here; see `/taccsite_custom` #}

{# Example #}
{% comment %}
{% block assets_custom %}
{{ block.super }}

{# Example: Custom Site Assets. #}
<link rel="stylesheet" href="{% static '__PROJECT__/css/build/site.css' %}">
Expand All @@ -37,5 +20,9 @@
{# WARNING: Undesired use case. Create re-usable code instead. #}
{# SEE: https://confluence.tacc.utexas.edu/x/54AZCg #}

{% endblock assets_custom %}
{# Example: Custom Fonts. #}
{% block assets_font %}
<!-- SEE: ./assets_font.html for examples -->
{% endblock assets_font %}

{% endcomment %}
9 changes: 0 additions & 9 deletions taccsite_cms/templates/assets_custom_delayed.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@
- Scripts can use `defer` or `async` attr's to manage load time.
{% endcomment %}

{# NOTE: Fonts may be loaded early via `assets_font` #}



{# Do NOT directly load project-specific assets here; see `/taccsite_custom` #}

{# Example #}
{% comment %}
{% block assets_custom_delayed %}
{{ block.super }}

{# Example: Custom Site Assets. #}
<link rel="stylesheet" href="{% static '__PROJECT__/css/build/site.css' %}">
Expand All @@ -28,5 +20,4 @@
{# WARNING: Undesired use case. Create re-usable code instead. #}
{# SEE: https://confluence.tacc.utexas.edu/x/54AZCg #}

{% endblock assets_custom_delayed %}
{% endcomment %}
2 changes: 1 addition & 1 deletion taccsite_cms/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{% include 'analytics.html' %}

<!-- Metadata. -->
<title>{% block title %} This is my new project home page {% endblock title %}</title>
<title>{% block title %}{% page_attribute "page_title" %}{% endblock title %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Expand Down
2 changes: 0 additions & 2 deletions taccsite_cms/templates/fullwidth.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "base.html" %}
{% load cms_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock title %}

{# To remove container and breadcrumbs #}
{% block content %}
{% placeholder "content" %}
Expand Down
2 changes: 0 additions & 2 deletions taccsite_cms/templates/sidebar_left.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "base.html" %}
{% load cms_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock title %}

{% block assets_custom %}
{{ block.super }}

Expand Down
2 changes: 0 additions & 2 deletions taccsite_cms/templates/sidebar_right.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "base.html" %}
{% load cms_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock title %}

{% block assets_custom %}
{{ block.super }}

Expand Down
2 changes: 0 additions & 2 deletions taccsite_cms/templates/standard.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
{% extends "base.html" %}
{% load cms_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock title %}