From 09a7bcbdef237c1443bbbfc29010e7106cffd739 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 21 Jan 2017 13:08:29 +0800 Subject: Refactor templates and rearrange its path --- public/views/body.ejs | 250 --------------------------------- public/views/disqus.ejs | 14 -- public/views/error.ejs | 6 +- public/views/foot.ejs | 28 ---- public/views/footer.ejs | 0 public/views/ga.ejs | 18 --- public/views/hackmd.ejs | 12 +- public/views/hackmd/body.ejs | 250 +++++++++++++++++++++++++++++++++ public/views/hackmd/foot.ejs | 28 ++++ public/views/hackmd/footer.ejs | 0 public/views/hackmd/head.ejs | 22 +++ public/views/hackmd/header.ejs | 175 +++++++++++++++++++++++ public/views/head.ejs | 22 --- public/views/header.ejs | 175 ----------------------- public/views/help-modal.ejs | 147 ------------------- public/views/index.ejs | 216 +--------------------------- public/views/index/body.ejs | 175 +++++++++++++++++++++++ public/views/index/foot.ejs | 13 ++ public/views/index/footer.ejs | 0 public/views/index/head.ejs | 22 +++ public/views/index/header.ejs | 0 public/views/polyfill.ejs | 7 - public/views/pretty.ejs | 14 +- public/views/refresh-modal.ejs | 31 ---- public/views/revision-modal.ejs | 27 ---- public/views/shared/disqus.ejs | 14 ++ public/views/shared/ga.ejs | 18 +++ public/views/shared/help-modal.ejs | 147 +++++++++++++++++++ public/views/shared/polyfill.ejs | 7 + public/views/shared/refresh-modal.ejs | 31 ++++ public/views/shared/revision-modal.ejs | 27 ++++ public/views/shared/signin-modal.ejs | 95 +++++++++++++ public/views/signin-modal.ejs | 95 ------------- public/views/slide.ejs | 14 +- 34 files changed, 1052 insertions(+), 1048 deletions(-) delete mode 100644 public/views/body.ejs delete mode 100644 public/views/disqus.ejs delete mode 100644 public/views/foot.ejs delete mode 100644 public/views/footer.ejs delete mode 100644 public/views/ga.ejs create mode 100644 public/views/hackmd/body.ejs create mode 100644 public/views/hackmd/foot.ejs create mode 100644 public/views/hackmd/footer.ejs create mode 100644 public/views/hackmd/head.ejs create mode 100644 public/views/hackmd/header.ejs delete mode 100644 public/views/head.ejs delete mode 100644 public/views/header.ejs delete mode 100644 public/views/help-modal.ejs create mode 100644 public/views/index/body.ejs create mode 100644 public/views/index/foot.ejs create mode 100644 public/views/index/footer.ejs create mode 100644 public/views/index/head.ejs create mode 100644 public/views/index/header.ejs delete mode 100644 public/views/polyfill.ejs delete mode 100644 public/views/refresh-modal.ejs delete mode 100644 public/views/revision-modal.ejs create mode 100644 public/views/shared/disqus.ejs create mode 100644 public/views/shared/ga.ejs create mode 100644 public/views/shared/help-modal.ejs create mode 100644 public/views/shared/polyfill.ejs create mode 100644 public/views/shared/refresh-modal.ejs create mode 100644 public/views/shared/revision-modal.ejs create mode 100644 public/views/shared/signin-modal.ejs delete mode 100644 public/views/signin-modal.ejs (limited to 'public/views') diff --git a/public/views/body.ejs b/public/views/body.ejs deleted file mode 100644 index 5ad1733e..00000000 --- a/public/views/body.ejs +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - - - - - - - - - - -<%- include refresh-modal %> -<%- include signin-modal %> -<%- include help-modal %> -<%- include revision-modal %> diff --git a/public/views/disqus.ejs b/public/views/disqus.ejs deleted file mode 100644 index cceaa85c..00000000 --- a/public/views/disqus.ejs +++ /dev/null @@ -1,14 +0,0 @@ -
- - - \ No newline at end of file diff --git a/public/views/error.ejs b/public/views/error.ejs index 402b5eb0..a40ed39c 100644 --- a/public/views/error.ejs +++ b/public/views/error.ejs @@ -2,18 +2,18 @@ - <%- include head %> + <%- include hackmd/head %> - <%- include header %> + <%- include hackmd/header %>

<%- code %> <%- detail %> <%- msg %>

- <%- include footer %> + <%- include hackmd/footer %> \ No newline at end of file diff --git a/public/views/foot.ejs b/public/views/foot.ejs deleted file mode 100644 index c1df65c2..00000000 --- a/public/views/foot.ejs +++ /dev/null @@ -1,28 +0,0 @@ - -<% if(useCDN) { %> - - - - - - - - - - - - - - - - - - -<%- include build/index-scripts %> -<% } else { %> - - -<%- include build/index-pack-scripts %> -<% } %> diff --git a/public/views/footer.ejs b/public/views/footer.ejs deleted file mode 100644 index e69de29b..00000000 diff --git a/public/views/ga.ejs b/public/views/ga.ejs deleted file mode 100644 index 66d4acd9..00000000 --- a/public/views/ga.ejs +++ /dev/null @@ -1,18 +0,0 @@ -<% if(typeof GA !== 'undefined' && GA) { %> - -<% } %> \ No newline at end of file diff --git a/public/views/hackmd.ejs b/public/views/hackmd.ejs index c5778fc9..49084a63 100644 --- a/public/views/hackmd.ejs +++ b/public/views/hackmd.ejs @@ -2,14 +2,14 @@ - <%- include head %> + <%- include hackmd/head %> - <%- include header %> - <%- include body %> - <%- include footer %> - <%- include foot %> + <%- include hackmd/header %> + <%- include hackmd/body %> + <%- include hackmd/footer %> + <%- include hackmd/foot %> - \ No newline at end of file + diff --git a/public/views/hackmd/body.ejs b/public/views/hackmd/body.ejs new file mode 100644 index 00000000..d8a3f108 --- /dev/null +++ b/public/views/hackmd/body.ejs @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + +<%- include ../shared/refresh-modal %> +<%- include ../shared/signin-modal %> +<%- include ../shared/help-modal %> +<%- include ../shared/revision-modal %> diff --git a/public/views/hackmd/foot.ejs b/public/views/hackmd/foot.ejs new file mode 100644 index 00000000..178b5504 --- /dev/null +++ b/public/views/hackmd/foot.ejs @@ -0,0 +1,28 @@ + +<% if(useCDN) { %> + + + + + + + + + + + + + + + + + + +<%- include ../build/index-scripts %> +<% } else { %> + + +<%- include ../build/index-pack-scripts %> +<% } %> diff --git a/public/views/hackmd/footer.ejs b/public/views/hackmd/footer.ejs new file mode 100644 index 00000000..e69de29b diff --git a/public/views/hackmd/head.ejs b/public/views/hackmd/head.ejs new file mode 100644 index 00000000..d0663993 --- /dev/null +++ b/public/views/hackmd/head.ejs @@ -0,0 +1,22 @@ + + + + + + +<%= title %> + + +<% if(useCDN) { %> + + + + + + +<%- include ../build/index-header %> +<% } else { %> + +<%- include ../build/index-pack-header %> +<% } %> +<%- include ../shared/polyfill %> \ No newline at end of file diff --git a/public/views/hackmd/header.ejs b/public/views/hackmd/header.ejs new file mode 100644 index 00000000..bb4e3174 --- /dev/null +++ b/public/views/hackmd/header.ejs @@ -0,0 +1,175 @@ + +
diff --git a/public/views/head.ejs b/public/views/head.ejs deleted file mode 100644 index 218847f7..00000000 --- a/public/views/head.ejs +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -<%= title %> - - -<% if(useCDN) { %> - - - - - - -<%- include build/index-header %> -<% } else { %> - -<%- include build/index-pack-header %> -<% } %> -<%- include polyfill %> \ No newline at end of file diff --git a/public/views/header.ejs b/public/views/header.ejs deleted file mode 100644 index bb4e3174..00000000 --- a/public/views/header.ejs +++ /dev/null @@ -1,175 +0,0 @@ - -
diff --git a/public/views/help-modal.ejs b/public/views/help-modal.ejs deleted file mode 100644 index b1ea681d..00000000 --- a/public/views/help-modal.ejs +++ /dev/null @@ -1,147 +0,0 @@ - - - \ No newline at end of file diff --git a/public/views/index.ejs b/public/views/index.ejs index 4bcea0eb..5732db4a 100644 --- a/public/views/index.ejs +++ b/public/views/index.ejs @@ -2,220 +2,14 @@ - - - - - - - - - HackMD - <%= __('Collaborative markdown notes') %> - - - <% if(useCDN) { %> - - - - - - <%- include build/cover-header %> - <% } else { %> - <%- include build/cover-pack-header %> - <% } %> - <%- include polyfill %> + <%- include index/head %> -
-
-
- -
-
-

- -
-
- -
style="display:none;"<% } %>> -
-

HackMD

-

- <%= __('Best way to write and share your knowledge in markdown.') %> -

- <% if (infoMessage && infoMessage.length > 0) { %> -
<%= infoMessage %>
- <% } %> - <% if (errorMessage && errorMessage.length > 0) { %> -
<%= errorMessage %>
- <% } %> - <% if(facebook || twitter || github || gitlab || dropbox || google || ldap || email) { %> - - <%= __('or') %> - <% } %> - - -
-
- -
style="display:none;"<% } %>> - -
-
-
- -
-
- -
- - <%= __('Title') %> - - - <%= __('Time') %> - - - -
- - -
    -
-
    -
    - -
    -
    - -

    - © 2017 HackMD | <%= __('Releases') %> -

    - -
    -
    -
    -
    -
    - - - <%- include signin-modal %> - - <% if(useCDN) { %> - - - - - - - - - <%- include build/cover-scripts %> - <% } else { %> - <%- include build/cover-pack-scripts %> - <% } %> + <%- include index/header %> + <%- include index/body %> + <%- include index/footer %> + <%- include index/foot %> diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs new file mode 100644 index 00000000..b8072450 --- /dev/null +++ b/public/views/index/body.ejs @@ -0,0 +1,175 @@ +
    +
    +
    + +
    +
    +

    + +
    +
    + +
    style="display:none;"<% } %>> +
    +

    HackMD

    +

    + <%= __('Best way to write and share your knowledge in markdown.') %> +

    + <% if (infoMessage && infoMessage.length > 0) { %> +
    <%= infoMessage %>
    + <% } %> + <% if (errorMessage && errorMessage.length > 0) { %> +
    <%= errorMessage %>
    + <% } %> + <% if(facebook || twitter || github || gitlab || dropbox || google || ldap || email) { %> + + <%= __('or') %> + <% } %> + + +
    +
    + +
    style="display:none;"<% } %>> + +
    +
    +
    + +
    +
    + +
    + + <%= __('Title') %> + + + <%= __('Time') %> + + + +
    + + +
      +
    +
      +
      + +
      +
      + +

      + © 2017 HackMD | <%= __('Releases') %> +

      + +
      +
      +
      +
      +
      + + +<%- include ../shared/signin-modal %> \ No newline at end of file diff --git a/public/views/index/foot.ejs b/public/views/index/foot.ejs new file mode 100644 index 00000000..293c6698 --- /dev/null +++ b/public/views/index/foot.ejs @@ -0,0 +1,13 @@ +<% if(useCDN) { %> + + + + + + + + +<%- include ../build/cover-scripts %> +<% } else { %> +<%- include ../build/cover-pack-scripts %> +<% } %> \ No newline at end of file diff --git a/public/views/index/footer.ejs b/public/views/index/footer.ejs new file mode 100644 index 00000000..e69de29b diff --git a/public/views/index/head.ejs b/public/views/index/head.ejs new file mode 100644 index 00000000..bbd14567 --- /dev/null +++ b/public/views/index/head.ejs @@ -0,0 +1,22 @@ + + + + + + + + +HackMD - <%= __('Collaborative markdown notes') %> + + +<% if(useCDN) { %> + + + + + +<%- include ../build/cover-header %> +<% } else { %> +<%- include ../build/cover-pack-header %> +<% } %> +<%- include ../shared/polyfill %> \ No newline at end of file diff --git a/public/views/index/header.ejs b/public/views/index/header.ejs new file mode 100644 index 00000000..e69de29b diff --git a/public/views/polyfill.ejs b/public/views/polyfill.ejs deleted file mode 100644 index 5c885642..00000000 --- a/public/views/polyfill.ejs +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index ced65ed8..de5b8ad3 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -23,12 +23,12 @@ - <%- include build/pretty-header %> + <%- include ../build/pretty-header %> <% } else { %> - <%- include build/pretty-pack-header %> + <%- include ../build/pretty-pack-header %> <% } %> - <%- include polyfill %> + <%- include ../shared/polyfill %> @@ -66,7 +66,7 @@ <% if(typeof disqus !== 'undefined' && disqus) { %>
      - <%- include disqus %> + <%- include ../shared/disqus %>
      <% } %> @@ -90,10 +90,10 @@ -<%- include build/pretty-scripts %> +<%- include ../build/pretty-scripts %> <% } else { %> -<%- include build/pretty-pack-scripts %> +<%- include ../build/pretty-pack-scripts %> <% } %> -<%- include ga %> +<%- include ../shared/ga %> diff --git a/public/views/refresh-modal.ejs b/public/views/refresh-modal.ejs deleted file mode 100644 index 5be41b2a..00000000 --- a/public/views/refresh-modal.ejs +++ /dev/null @@ -1,31 +0,0 @@ - - \ No newline at end of file diff --git a/public/views/revision-modal.ejs b/public/views/revision-modal.ejs deleted file mode 100644 index f824cf06..00000000 --- a/public/views/revision-modal.ejs +++ /dev/null @@ -1,27 +0,0 @@ - - \ No newline at end of file diff --git a/public/views/shared/disqus.ejs b/public/views/shared/disqus.ejs new file mode 100644 index 00000000..cceaa85c --- /dev/null +++ b/public/views/shared/disqus.ejs @@ -0,0 +1,14 @@ +
      + + + \ No newline at end of file diff --git a/public/views/shared/ga.ejs b/public/views/shared/ga.ejs new file mode 100644 index 00000000..66d4acd9 --- /dev/null +++ b/public/views/shared/ga.ejs @@ -0,0 +1,18 @@ +<% if(typeof GA !== 'undefined' && GA) { %> + +<% } %> \ No newline at end of file diff --git a/public/views/shared/help-modal.ejs b/public/views/shared/help-modal.ejs new file mode 100644 index 00000000..b1ea681d --- /dev/null +++ b/public/views/shared/help-modal.ejs @@ -0,0 +1,147 @@ + + + \ No newline at end of file diff --git a/public/views/shared/polyfill.ejs b/public/views/shared/polyfill.ejs new file mode 100644 index 00000000..5c885642 --- /dev/null +++ b/public/views/shared/polyfill.ejs @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/public/views/shared/refresh-modal.ejs b/public/views/shared/refresh-modal.ejs new file mode 100644 index 00000000..5be41b2a --- /dev/null +++ b/public/views/shared/refresh-modal.ejs @@ -0,0 +1,31 @@ + + \ No newline at end of file diff --git a/public/views/shared/revision-modal.ejs b/public/views/shared/revision-modal.ejs new file mode 100644 index 00000000..f824cf06 --- /dev/null +++ b/public/views/shared/revision-modal.ejs @@ -0,0 +1,27 @@ + + \ No newline at end of file diff --git a/public/views/shared/signin-modal.ejs b/public/views/shared/signin-modal.ejs new file mode 100644 index 00000000..a8af62e7 --- /dev/null +++ b/public/views/shared/signin-modal.ejs @@ -0,0 +1,95 @@ + + diff --git a/public/views/signin-modal.ejs b/public/views/signin-modal.ejs deleted file mode 100644 index a8af62e7..00000000 --- a/public/views/signin-modal.ejs +++ /dev/null @@ -1,95 +0,0 @@ - - diff --git a/public/views/slide.ejs b/public/views/slide.ejs index b0323a0e..eb1453f8 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -23,10 +23,10 @@ - <%- include build/slide-header %> + <%- include ../build/slide-header %> <% } else { %> - <%- include build/slide-pack-header %> + <%- include ../build/slide-pack-header %> <% } %> @@ -45,7 +45,7 @@ document.getElementsByTagName( 'head' )[0].appendChild( link ); - <%- include polyfill %> + <%- include ../shared/polyfill %>
      @@ -79,7 +79,7 @@
      <% if(typeof disqus !== 'undefined' && disqus) { %>
      - <%- include disqus %> + <%- include ../shared/disqus %>
      <% } %> @@ -104,13 +104,13 @@ - <%- include build/slide-scripts %> + <%- include ../build/slide-scripts %> <% } else { %> - <%- include build/slide-pack-scripts %> + <%- include ../build/slide-pack-scripts %> <% } %> -<%- include ga %> +<%- include ../shared/ga %> -- cgit v1.2.3 From a669c201beb3755703e87984268cbd08145e9ac6 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 21 Jan 2017 13:40:08 +0800 Subject: Fix template partial path --- public/views/pretty.ejs | 14 +++++++------- public/views/slide.ejs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'public/views') diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index de5b8ad3..a6913f6c 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -23,12 +23,12 @@ - <%- include ../build/pretty-header %> + <%- include build/pretty-header %> <% } else { %> - <%- include ../build/pretty-pack-header %> + <%- include build/pretty-pack-header %> <% } %> - <%- include ../shared/polyfill %> + <%- include shared/polyfill %> @@ -66,7 +66,7 @@ <% if(typeof disqus !== 'undefined' && disqus) { %>
      - <%- include ../shared/disqus %> + <%- include shared/disqus %>
      <% } %> @@ -90,10 +90,10 @@ -<%- include ../build/pretty-scripts %> +<%- include build/pretty-scripts %> <% } else { %> -<%- include ../build/pretty-pack-scripts %> +<%- include build/pretty-pack-scripts %> <% } %> -<%- include ../shared/ga %> +<%- include shared/ga %> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index eb1453f8..ffbfdce6 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -23,10 +23,10 @@ - <%- include ../build/slide-header %> + <%- include build/slide-header %> <% } else { %> - <%- include ../build/slide-pack-header %> + <%- include build/slide-pack-header %> <% } %> @@ -45,7 +45,7 @@ document.getElementsByTagName( 'head' )[0].appendChild( link ); - <%- include ../shared/polyfill %> + <%- include shared/polyfill %>
      @@ -79,7 +79,7 @@
      <% if(typeof disqus !== 'undefined' && disqus) { %>
      - <%- include ../shared/disqus %> + <%- include shared/disqus %>
      <% } %> @@ -104,13 +104,13 @@ - <%- include ../build/slide-scripts %> + <%- include build/slide-scripts %> <% } else { %> - <%- include ../build/slide-pack-scripts %> + <%- include build/slide-pack-scripts %> <% } %> -<%- include ../shared/ga %> +<%- include shared/ga %> -- cgit v1.2.3