1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

preview-dev env

This commit is contained in:
codecalm
2022-10-20 23:54:47 +02:00
parent 72d1eb5130
commit 3c41a6bbdf
9 changed files with 24 additions and 25 deletions

View File

@@ -358,7 +358,11 @@ gulp.task('build-jekyll', (cb) => {
var env = Object.create(process.env) var env = Object.create(process.env)
if (argv.preview) { if (argv.preview) {
if (argv.dev) {
env.JEKYLL_ENV = 'preview-dev'
} else {
env.JEKYLL_ENV = 'preview' env.JEKYLL_ENV = 'preview'
}
} else { } else {
env.JEKYLL_ENV = 'production' env.JEKYLL_ENV = 'production'
} }

View File

@@ -8,6 +8,7 @@
"start-plugins": "gulp start --with-plugins", "start-plugins": "gulp start --with-plugins",
"build": "gulp build", "build": "gulp build",
"preview": "gulp build --preview", "preview": "gulp build --preview",
"preview-dev": "gulp build --preview --dev",
"svg-optimize": "svgo -f svg/brand --pretty", "svg-optimize": "svgo -f svg/brand --pretty",
"unused-files": "node build/unused-files.js", "unused-files": "node build/unused-files.js",
"release": "release-it", "release": "release-it",

View File

@@ -9,16 +9,16 @@
{% for lib in site.data.libs.css %} {% for lib in site.data.libs.css %}
{% if libs contains lib[0] %} {% if libs contains lib[0] %}
{% for file in lib[1] %} {% for file in lib[1] %}
<link href="{% if file contains 'http://' or file contains 'https://' %}{{ file }}{% else %}{{ site.base }}/{% if jekyll.environment != 'development' %}dist/libs{% else %}node_modules{% endif %}/{% if jekyll.environment != 'development' %}{{ file | replace: '@', '' }}{% else %}{{ file }}{% endif %}{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}{% endif %}" rel="stylesheet"/> <link href="{% if file contains 'http://' or file contains 'https://' %}{{ file }}{% else %}{{ site.base }}/{% if jekyll.environment != 'development' %}dist/libs{% else %}node_modules{% endif %}/{% if jekyll.environment != 'development' %}{{ file | replace: '@', '' }}{% else %}{{ file }}{% endif %}{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}{% endif %}" rel="stylesheet"/>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<link href="{{ site.base }}/dist/css/tabler{% if page.rtl or site.rtl %}.rtl{% endif %}{% if jekyll.environment != 'development' %}.min{% endif %}.css{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}" rel="stylesheet"/> <link href="{{ site.base }}/dist/css/tabler{% if page.rtl or site.rtl %}.rtl{% endif %}{% if jekyll.environment != 'development' %}.min{% endif %}.css{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" rel="stylesheet"/>
{% for plugin in site.tabler-css-plugins %} {% for plugin in site.tabler-css-plugins %}
<link href="{{ site.base }}/dist/css/{{ plugin }}{% if page.rtl or site.rtl %}.rtl{% endif %}{% if jekyll.environment != 'development' %}.min{% endif %}.css{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}" rel="stylesheet"/> <link href="{{ site.base }}/dist/css/{{ plugin }}{% if page.rtl or site.rtl %}.rtl{% endif %}{% if jekyll.environment != 'development' %}.min{% endif %}.css{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" rel="stylesheet"/>
{% endfor %} {% endfor %}
<link href="{{ site.base }}/dist/css/demo{% if page.rtl or site.rtl %}.rtl{% endif %}{% if jekyll.environment != 'development' %}.min{% endif %}.css{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}" rel="stylesheet"/> <link href="{{ site.base }}/dist/css/demo{% if page.rtl or site.rtl %}.rtl{% endif %}{% if jekyll.environment != 'development' %}.min{% endif %}.css{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" rel="stylesheet"/>

View File

@@ -22,7 +22,7 @@
All rights reserved. All rights reserved.
</li> </li>
<li class="list-inline-item"> <li class="list-inline-item">
{% if jekyll.environment != 'development' %} {% if jekyll.environment == 'preview' or jekyll.environment == 'production' %}
<a href="{{ site.base }}/changelog.html" class="link-secondary" rel="noopener"> <a href="{{ site.base }}/changelog.html" class="link-secondary" rel="noopener">
v{{ site.data.package.version }} v{{ site.data.package.version }}
</a> </a>

View File

@@ -2,22 +2,22 @@
{% assign libs = page.libs | default: layout.libs %} {% assign libs = page.libs | default: layout.libs %}
{% assign google-maps-key = site.google-maps-dev-key %} {% assign google-maps-key = site.google-maps-dev-key %}
{% if jekyll.environment == 'preview' %} {% if jekyll.environment != 'development' %}
{% assign google-maps-key = site.google-maps-key %} {% assign google-maps-key = site.google-maps-key %}
{% endif %} {% endif %}
{% for lib in site.data.libs.js %} {% for lib in site.data.libs.js %}
{% if libs contains lib[0] or site.data.libs.global-libs contains lib[0] %} {% if libs contains lib[0] or site.data.libs.global-libs contains lib[0] %}
{% for file in lib[1] %} {% for file in lib[1] %}
<script src="{% if file contains 'http://' or file contains 'https://' %}{{ file | replace: 'GOOGLE_MAPS_KEY', google-maps-key }}{% else %}{{ site.base }}/{% if jekyll.environment != 'development' %}dist/libs{% else %}node_modules{% endif %}/{% if jekyll.environment != 'development' %}{{ file | replace: '@', '' }}{% else %}{{ file }}{% endif %}{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}{% endif %}" defer></script> <script src="{% if file contains 'http://' or file contains 'https://' %}{{ file | replace: 'GOOGLE_MAPS_KEY', google-maps-key }}{% else %}{{ site.base }}/{% if jekyll.environment != 'development' %}dist/libs{% else %}node_modules{% endif %}/{% if jekyll.environment != 'development' %}{{ file | replace: '@', '' }}{% else %}{{ file }}{% endif %}{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}{% endif %}" defer></script>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<!-- Tabler Core --> <!-- Tabler Core -->
<script src="{{ site.base }}/dist/js/tabler{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}" defer></script> <script src="{{ site.base }}/dist/js/tabler{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" defer></script>
<script src="{{ site.base }}/dist/js/demo{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}" defer></script> <script src="{{ site.base }}/dist/js/demo{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}" defer></script>
{% removeemptylines %} {% removeemptylines %}

View File

@@ -1,13 +1,13 @@
<meta name="twitter:image:src" content="{% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}/static/og.png"> <meta name="twitter:image:src" content="{% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}/static/og.png">
<meta name="twitter:site" content="@tabler_ui"> <meta name="twitter:site" content="@tabler_ui">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Tabler: Premium and Open Source dashboard template with responsive and high quality UI."> <meta name="twitter:title" content="Tabler: Premium and Open Source dashboard template with responsive and high quality UI.">
<meta name="twitter:description" content="Tabler comes with tons of well-designed components and features. Start your adventure with Tabler and make your dashboard great again. For free!"> <meta name="twitter:description" content="Tabler comes with tons of well-designed components and features. Start your adventure with Tabler and make your dashboard great again. For free!">
<meta property="og:image" content="{% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}/static/og.png"> <meta property="og:image" content="{% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}/static/og.png">
<meta property="og:image:width" content="1280"> <meta property="og:image:width" content="1280">
<meta property="og:image:height" content="640"> <meta property="og:image:height" content="640">
<meta property="og:site_name" content="Tabler"> <meta property="og:site_name" content="Tabler">
<meta property="og:type" content="object"> <meta property="og:type" content="object">
<meta property="og:title" content="Tabler: Premium and Open Source dashboard template with responsive and high quality UI."> <meta property="og:title" content="Tabler: Premium and Open Source dashboard template with responsive and high quality UI.">
<meta property="og:url" content="{% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}/static/og.png"> <meta property="og:url" content="{% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}/static/og.png">
<meta property="og:description" content="Tabler comes with tons of well-designed components and features. Start your adventure with Tabler and make your dashboard great again. For free!"> <meta property="og:description" content="Tabler comes with tons of well-designed components and features. Start your adventure with Tabler and make your dashboard great again. For free!">

View File

@@ -9,7 +9,7 @@
<title>{% if title %}{{ title }} - {% endif %}{% if site.title %}{{ site.title }} - {% endif %}{{ site.description }}</title> <title>{% if title %}{{ title }} - {% endif %}{% if site.title %}{{ site.title }} - {% endif %}{{ site.description }}</title>
{% if jekyll.environment == 'preview' %} {% if jekyll.environment == 'preview' or jekyll.environment == 'preview-dev' %}
{% include layout/analytics.html %} {% include layout/analytics.html %}
<meta name="msapplication-TileColor" content="{{ site.data.colors.blue }}"/> <meta name="msapplication-TileColor" content="{{ site.data.colors.blue }}"/>
@@ -41,18 +41,12 @@
{% assign layout-dark = page.layout-dark | default: site.layout-dark %} {% assign layout-dark = page.layout-dark | default: site.layout-dark %}
<body {% if layout.body-class or page.body-class %} class="{% if layout.body-class %} {{ layout.body-class }}{% endif %}{% if page.body-class %} {{ page.body-class }}{% endif %}"{% endif %}> <body {% if layout.body-class or page.body-class %} class="{% if layout.body-class %} {{ layout.body-class }}{% endif %}{% if page.body-class %} {{ page.body-class }}{% endif %}"{% endif %}>
<script src="{{ site.base }}/dist/js/demo-theme{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment == 'preview' %}?{{ site.time | date: '%s' }}{% endif %}"></script> <script src="{{ site.base }}/dist/js/demo-theme{% if jekyll.environment != 'development' %}.min{% endif %}.js{% if jekyll.environment != 'development' %}?{{ site.time | date: '%s' }}{% endif %}"></script>
{{ content }} {{ content }}
{% include layout/modals-capture.html %} {% include layout/modals-capture.html %}
{% comment %}
{% if jekyll.environment == 'preview' %}
{% include layout/sentry.html %}
{% endif %}
{% endcomment %}
{% include layout/js.html %} {% include layout/js.html %}
{% if site.debug and jekyll.environment == 'development' %} {% if site.debug and jekyll.environment == 'development' %}

View File

@@ -1,4 +1,4 @@
--- ---
layout: none layout: none
--- ---
Sitemap: {% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}{{ "sitemap.xml" | absolute_url }} Sitemap: {% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}{{ "sitemap.xml" | absolute_url }}

View File

@@ -8,7 +8,7 @@ layout: none
{% assign docs = collection.docs | where_exp:'doc','doc.sitemap != false' %} {% assign docs = collection.docs | where_exp:'doc','doc.sitemap != false' %}
{% for doc in docs %} {% for doc in docs %}
<url> <url>
<loc>{% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}{{ doc.url | replace: '/index.html', '/' | absolute_url | xml_escape }}</loc> <loc>{% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}{{ doc.url | replace: '/index.html', '/' | absolute_url | xml_escape }}</loc>
{% if doc.last_modified_at or doc.date %} {% if doc.last_modified_at or doc.date %}
<lastmod>{{ doc.last_modified_at | default: doc.date | date_to_xmlschema }}</lastmod> <lastmod>{{ doc.last_modified_at | default: doc.date | date_to_xmlschema }}</lastmod>
{% endif %} {% endif %}
@@ -19,7 +19,7 @@ layout: none
{% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %} {% assign pages = site.html_pages | where_exp:'doc','doc.sitemap != false' | where_exp:'doc','doc.url != "/404.html"' %}
{% for page in pages %} {% for page in pages %}
<url> <url>
<loc>{% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}{{ page.url | replace: '/index.html', '/' | absolute_url | xml_escape }}</loc> <loc>{% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}{{ page.url | replace: '/index.html', '/' | absolute_url | xml_escape }}</loc>
<lastmod>{{ page.last_modified_at | default: site.time | date_to_xmlschema }}</lastmod> <lastmod>{{ page.last_modified_at | default: site.time | date_to_xmlschema }}</lastmod>
</url> </url>
{% endfor %} {% endfor %}
@@ -27,7 +27,7 @@ layout: none
{% assign static_files = page.static_files | where_exp:'page','page.sitemap != false' | where_exp:'page','page.name != "404.html"' %} {% assign static_files = page.static_files | where_exp:'page','page.sitemap != false' | where_exp:'page','page.name != "404.html"' %}
{% for file in static_files %} {% for file in static_files %}
<url> <url>
<loc>{% if jekyll.environment == 'preview' %}{{ site.preview-url }}{% endif %}{{ file.path | replace:'/index.html','/' | absolute_url | xml_escape }}</loc> <loc>{% if jekyll.environment != 'development' %}{{ site.preview-url }}{% endif %}{{ file.path | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
<lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod> <lastmod>{{ file.modified_time | date_to_xmlschema }}</lastmod>
</url> </url>
{% endfor %} {% endfor %}