Skip to content

Commit

Permalink
Feature/docsearch3 (#80)
Browse files Browse the repository at this point in the history
* css 설명 보강

* 인공지능 블록

* docsearch v3 migration

---------

Co-authored-by: kim jeong yong <[email protected]>
  • Loading branch information
kimorkim and kim jeong yong authored Apr 23, 2024
1 parent 5227b2b commit 994f5bf
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 11 deletions.
40 changes: 33 additions & 7 deletions themes/vue/layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,51 @@
<script src="<%- url_for("/js/common.js") %>"></script>

<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
<style>
:root {
--docsearch-primary-color: #42b983;
}
.DocSearch-Button {
background: #ffffff;
border: 1px solid #e3e3e3;
height: 30px;
line-height: 30px;
}
.DocSearch-Button:active, .DocSearch-Button:focus, .DocSearch-Button:hover {
background: var(--docsearch-searchbox-focus-background);
box-shadow: var(--docsearch-searchbox-shadow);
color: #2c3e50;
outline: none;
}
.DocSearch-Button-Placeholder {
font-size: 0.9rem;
}
.search-query-nav-wrapper {
vertical-align: middle !important;
}
</style>
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script>
[
'#search-query-nav',
'#search-query-sidebar',
'#search-query-menu'
].forEach(function (selector) {
if (!document.querySelector(selector)) return
// search index defaults to v2
var match = window.location.pathname.match(/^\/(v\d+)/)
var version = match ? match[1] : 'v2'
docsearch({
apiKey: 'ac74b4b1e90e6f709527919849a9ab2e',
container: selector,
appId: 'SA68SZF1Z4',
apiKey: '2148f56602c452593e686003893d065b',
indexName: 'entrylabs',
inputSelector: selector,
debug: false // Set debug to true if you want to inspect the dropdown
})
insights: true
});
})
</script>

Expand Down
120 changes: 120 additions & 0 deletions themes/vue/layout/layout2.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<% var isIndex = page.path === 'index.html' %>
<!DOCTYPE html>
<html lang="ko">
<head>
<title><%- page.title ? page.title + '' : '' %>Entry Docs</title>
<meta charset="utf-8">
<meta name="description" content="<%- theme.site_description %>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="naver-site-verification" content="7fccc7599f015b17cda0f00b5575cd2d4c5777fd" />

<%- autoCanonical(config, page) %>

<meta property="og:type" content="article">
<meta property="og:title" content="<%- page.title ? page.title + ' — ' : '' %>Entry Docs">
<meta property="og:description" content="<%- page.description ? page.description : theme.site_description %>">
<meta property="og:image" content="https://<%- theme.root_domain %>/images/logo.png">

<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="<%- page.title ? page.title + ' — ' : '' %>Entry Docs">
<meta name="twitter:description" content="<%- page.description ? page.description : theme.site_description %>">
<meta name="twitter:image" content="https://<%- theme.root_domain %>/images/logo.png">

<link rel="apple-touch-icon" sizes="57x57" href="<%- url_for("/images/icons/apple-icon-57x57.png") %>">
<link rel="apple-touch-icon" sizes="60x60" href="<%- url_for("/images/icons/apple-icon-60x60.png") %>">
<link rel="apple-touch-icon" sizes="72x72" href="<%- url_for("/images/icons/apple-icon-72x72.png") %>">
<link rel="apple-touch-icon" sizes="76x76" href="<%- url_for("/images/icons/apple-icon-76x76.png") %>">
<link rel="apple-touch-icon" sizes="114x114" href="<%- url_for("/images/icons/apple-icon-114x114.png") %>">
<link rel="apple-touch-icon" sizes="120x120" href="<%- url_for("/images/icons/apple-icon-120x120.png") %>">
<link rel="apple-touch-icon" sizes="144x144" href="<%- url_for("/images/icons/apple-icon-144x144.png") %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%- url_for("/images/icons/apple-icon-152x152.png") %>">
<link rel="apple-touch-icon" sizes="180x180" href="<%- url_for("/images/icons/apple-icon-180x180.png") %>">
<link rel="icon" type="image/png" sizes="192x192" href="<%- url_for("/images/icons/android-icon-192x192.png") %>">
<link rel="icon" type="image/png" sizes="32x32" href="<%- url_for("/images/icons/favicon-32x32.png") %>">
<link rel="icon" type="image/png" sizes="96x96" href="<%- url_for("/images/icons/favicon-96x96.png") %>">
<link rel="icon" type="image/png" sizes="16x16" href="<%- url_for("/images/icons/favicon-16x16.png") %>">
<meta name="msapplication-TileImage" content="/images/icons/ms-icon-144x144.png">
<meta name="msapplication-TileColor" content="#4fc08d">
<meta name="theme-color" content="#4fc08d">

<meta name="msapplication-config" content="browserconfig.xml">
<link rel="manifest" href="/manifest.json">

<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Dosis:500' rel='stylesheet' type='text/css'>

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

<!-- main page styles -->
<%- css(isIndex ? 'css/index' : 'css/page') %>

<!-- this needs to be loaded before guide's inline scripts -->
<script>window.PAGE_TYPE = "<%- page.type %>"</script>

<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-103554573-1', 'auto');
ga('send', 'pageview');
</script>
<%- partial('partials/ld') %>
</head>
<body class="<%- isIndex ? '' : 'docs' -%>">
<div id="mobile-bar" <%- isIndex ? 'class="top"' : '' %>>
<a class="menu-button"></a>
<a class="logo" href="<%- url_for("/") %>"></a>
</div>
<%- partial('partials/header') %>
<% if (!isIndex) { %>
<div id="main" class="fix-sidebar">
<% if (page.blog_index) { %>
<%- partial('partials/blog') %>
<% } else { %>
<%- body %>
<% } %>
</div>
<script src="<%- url_for("/js/smooth-scroll.min.js") %>"></script>
<% } else { %>
<%- body %>
<% } %>

<!-- main custom script for sidebars, version selects etc. -->
<script src="<%- url_for("/js/css.escape.js") %>"></script>
<script src="<%- url_for("/js/common.js") %>"></script>

<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
<script>
[
'#search-query-nav',
'#search-query-sidebar',
'#search-query-menu'
].forEach(function (selector) {
if (!document.querySelector(selector)) return
// search index defaults to v2
var match = window.location.pathname.match(/^\/(v\d+)/)
var version = match ? match[1] : 'v2'
docsearch({
apiKey: 'ac74b4b1e90e6f709527919849a9ab2e',
indexName: 'entrylabs',
inputSelector: selector,
debug: false // Set debug to true if you want to inspect the dropdown
})
})
</script>

<!-- fastclick -->
<script src="//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body)
}, false)
</script>
</body>
</html>
6 changes: 2 additions & 4 deletions themes/vue/layout/partials/main_menu.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<li>
<form id="search-form">
<input type="text" id="search-query-<%- context %>" class="search-query st-default-search-input">
</form>
<li class="search-query-<%- context %>-wrapper">
<div id="search-query-<%- context %>"></div>
</li>
<li>
<a href="<%- url_for("/entryjs/") %>" class="nav-link<%- page.path.indexOf('entryjs') === 0 ? ' current' : '' %>" itemprop="url">개발 가이드</a>
Expand Down

0 comments on commit 994f5bf

Please sign in to comment.