mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
af6137248d
fixes #1765 fixes #1811 issue #1833 New UrlFor functions - moved body of url helper to config.path.urlFor, which can generate a URL for various scenarios - urlFor can take a string (name) or object (relativeUrl: '/') as the first argument - this is the first step towards issue #1833 - also added config.path.urlForPost which is async and handles getting permalink setting - frontend controller, ghost_head helper, cache invalidation all now use urlFor or urlForPost all urls should be correct and consistent URL Consistency Improvements - refactored invalidateCache into cacheInvalidationHeader which returns a promise so that url can be generated properly by urlForPost - moved isPost from models to schema, and refactored schema to have a tables object - deleted posts now return the whole object, not just id and slug, ensuring cache invalidation header can be set on delete - frontend controller rss and archive page redirects work properly with subdirectory - removes {{url}} helper from admin and client, and replaced with adminUrl helper which also uses urlFor - in res.locals ghostRoot becomes relativeUrl, and path is removed
27 lines
1.4 KiB
Handlebars
27 lines
1.4 KiB
Handlebars
<header id="global-header" class="navbar">
|
|
<a class="ghost-logo" href="{{adminUrl absolute="true" frontend="true"}}" data-off-canvas="left" title="{{adminUrl absolute="true" frontend="true"}}">
|
|
<span class="hidden">Ghost </span>
|
|
</a>
|
|
<nav id="global-nav" role="navigation">
|
|
<ul id="main-menu" >
|
|
{{#each adminNav}}
|
|
<li class="{{navClass}}{{#if selected}} active{{/if}}"><a href="{{adminUrl}}{{path}}">{{name}}</a></li>
|
|
{{/each}}
|
|
|
|
<li id="usermenu" class="subnav">
|
|
<a href="#" data-toggle="ul" class="dropdown">
|
|
<img class="avatar" src="{{#if currentUser.image}}{{currentUser.image}}{{else}}{{asset "shared/img/user-image.png"}}{{/if}}" alt="Avatar" />
|
|
<span class="name">{{#if currentUser.name}}{{currentUser.name}}{{else}}{{currentUser.email}}{{/if}}</span>
|
|
</a>
|
|
<ul class="overlay">
|
|
<li class="usermenu-profile"><a href="{{adminUrl}}/settings/user/">Your Profile</a></li>
|
|
<li class="divider"></li>
|
|
<li class="usermenu-help"><a href="http://ghost.org/forum/">Help / Support</a></li>
|
|
<li class="divider"></li>
|
|
<li class="usermenu-signout"><a href="{{adminUrl}}/signout/">Sign Out</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|