Skip to content
This repository was archived by the owner on Oct 27, 2023. It is now read-only.

Yj2175 207/header footer integration #1

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
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
50 changes: 50 additions & 0 deletions _static/css/theme-exceptions.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
body>img {
display:none;
}

.mainHeader .container {
padding: 0;
margin: 0 2rem;
max-width: 100%;
}
@media screen and (min-width: 1101px) {
.mainHeader .container {
margin: 0 10rem;
}
}

.mainHeader .container .content-container .mainNav .mainItem.search .search-border #close-search {
top: 0.6rem;
}

.mainHeader.active-search .container .mainNav .mainItem.search .search-border #input {
height: 3.3rem;
}

.mainHeader.active-search .container .mainNav .mainItem.search .search-border ::placeholder,
.mainHeader.active-search .container .mainNav .mainItem.search .search-border :-ms-input-placeholder,
.mainHeader.active-search .container .mainNav .mainItem.search .search-border ::-ms-input-placeholder {
color: #262626;
opacity: 1;
}

.Footer {
position: relative;
z-index: 1;
}

.Footer .mainNav,
.Footer .legalNav {
padding-left: 0rem;
padding-right: 0;
max-width: 90%;
}
.Footer .footerNav .mainItem a {
color: #bbbbbb;
}

.Footer .mainNav .footerNav .mainItem > ul {
margin-top: 2rem;
}

/*Main Footer exceptions*/
6 changes: 0 additions & 6 deletions _static/gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ Tested for Read the Docs theme 0.1.7 */
box-shadow: 0 0 15px rgba(142, 176, 202, 0.5);
}
.sphx-glr-thumbcontainer a.internal {
bottom: 0;
display: block;
left: 0;
padding: 150px 10px 0;
position: absolute;
right: 0;
top: 0;
}
/* Next one is to avoid Sphinx traditional theme to cover all the
thumbnail with its default link Background color */
Expand Down
2 changes: 1 addition & 1 deletion _static/images/chevron-down-grey.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions _static/images/pytorch-colab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions _static/images/pytorch-download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions _static/images/pytorch-github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/card1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/card2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/card3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/card4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _static/img/card5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 15 additions & 7 deletions _templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{% extends "!layout.html" %}


{% block sidebartitle %}
<div class="versions">
<div class="current-version">{{ version }}</div>
</div>
{% endblock %}

{% block before_global_toc_sidebar %}
<p class="caption single-item{% if pagename == 'index' %} current{% endif %}">
<a class="caption-text reference internal" href="{{ pathto('index') }}">Overview</a>
</p>
{% endblock %}

{% block footer %}
{{ super() }}
<script>


//add microsoft link

if(window.location.href.indexOf("/beginner/basics/")!= -1)
{
if(window.location.href.indexOf("/beginner/basics/")!= -1) {
var url="https://docs.microsoft.com/learn/paths/pytorch-fundamentals/?wt.mc_id=aiml-7486-cxa";
switch(window.location.pathname.split("/").pop().replace('.html',''))
{
Expand Down Expand Up @@ -37,7 +49,7 @@
url="https://docs.microsoft.com/learn/modules/intro-machine-learning-pytorch/8-inference?WT.mc_id=aiml-7486-cxa";
}

$(".pytorch-call-to-action-links").children().first().before("<a href="+url+' data-behavior="call-to-action-event" data-response="Run in Microsoft Learn" target="_blank"><div id="microsoft-learn-link" style="padding-bottom: 0.625rem;border-bottom: 1px solid #f3f4f7;padding-right: 2.5rem;display: -webkit-box; display: -ms-flexbox; isplay: flex; -webkit-box-align: center;-ms-flex-align: center;align-items: center;"><img class="call-to-action-img" src="../../_static/images/microsoft-logo.svg"/><div class="call-to-action-desktop-view">Run in Microsoft Learn</div><div class="call-to-action-mobile-view">Learn</div></div></a>')
$(".pytorch-call-to-action-links").children().first().before("<a href="+url+' data-behavior="call-to-action-event" data-response="Run in Microsoft Learn" target="_blank"><div id="microsoft-learn-link"><img class="call-to-action-img" src="../../_static/images/microsoft-logo.svg"/><div class="call-to-action-desktop-view">Run in Microsoft Learn</div><div class="call-to-action-mobile-view">Learn</div></div></a>')
}

!function(f,b,e,v,n,t,s)
Expand Down Expand Up @@ -93,9 +105,5 @@
&noscript=1"/>
</noscript>

<script type="text/javascript">
var collapsedSections = ['PyTorch Recipes', 'Learning PyTorch', 'Image and Video', 'Audio', 'Text', 'Reinforcement Learning', 'Deploying PyTorch Models in Production', 'Code Transforms with FX', 'Frontend APIs', 'Extending PyTorch', 'Model Optimization', 'Parallel and Distributed Training', 'Mobile'];
</script>

<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&amp;guid=ON&amp;script=0"/>
{% endblock %}
14 changes: 14 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
'sphinxcontrib.katex',
'sphinx_copybutton',
'sphinx_gallery.gen_gallery',
'sphinx_tabs.tabs',
]


Expand Down Expand Up @@ -124,6 +125,19 @@
# The full version, including alpha/beta/rc tags.
release = torch.__version__

# POPULATE LINKS TO OTHER VERSIONS
try:
html_context
except NameError:
html_context = dict()

html_context['menus_api_endpoint'] = 'https://pytorch-org-preprod.go-vip.net/wp-json/pytorch/v1/menus'
html_context['pytorch_site_url'] = 'https://pytorch-org-preprod.go-vip.net'
html_context['header_css_file'] = html_context['pytorch_site_url'] + '/wp-content/themes/pytorch/assets/css/index.css'

sphinx_tabs_disable_tab_closing = True
sphinx_tabs_disable_css_loading = True

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
Expand Down
143 changes: 143 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,148 @@
Welcome to PyTorch Tutorials
============================

.. container:: cards

.. container:: title

WHAT'S NEW

.. container:: description

Lorem ipsum dolor sit amet, consectetur

.. container:: cards-container three-columns

.. container:: card

.. container:: image

.. image:: _static/img/card1.png

.. container:: featured

FEATURED

.. container:: title

Tutorial

.. container:: subtitle

Learn the Basics

.. container:: description

A step-by-step guide to building a complete ML workflow with PyTorch.

.. container:: tags

tag 1, tag 2, tag 3

.. container:: card

.. container:: image

.. image:: _static/img/card2.png

.. container:: title

Tutorial

.. container:: subtitle

Sequence-to-Sequence Modeling with nn.Transformer and torchtext

.. container:: description

A step-by-step guide to building a complete ML workflow with PyTorch.

.. container:: tags

tag 1, tag 2, tag 3

.. container:: card

.. container:: image

.. image:: _static/img/card1.png

.. container:: featured

FEATURED

.. container:: title

Tutorial

.. container:: subtitle

Learn the Basics

.. container:: description

A step-by-step guide to building a complete ML workflow with PyTorch.

.. container:: tags

tag 1, tag 2, tag 3


.. container:: cards

.. container:: cards-container two-columns

.. container:: title-container

.. container:: main-title

LEARN THE BASICS

.. container:: main-description

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac velit vel elit sollicitudin mattis nec.

.. container:: title-container

.. container:: main-title

PYTORCH RECIPES

.. container:: main-description

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac velit vel elit sollicitudin mattis nec.

.. container:: cards-container two-columns

.. container:: card

.. container:: image

.. image:: _static/img/card1.png

.. container:: subtitle

Lorem Ipusm esta con les tues esta me

.. container:: link

`Get Started with Pytorch <https://pytorch.org>`_

.. container:: card

.. container:: image

.. image:: _static/img/card2.png

.. container:: subtitle

Sequence-to-Sequence Modeling with nn.Transformer and torchtext

.. container:: link

`View The Full Recipes <https://pytorch.org>`_


.. raw:: html

<div class="tutorials-callout-container">
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Refer to ./jenkins/build.sh for tutorial build instructions

sphinx==1.8.2
sphinx==3.5.4
sphinx-gallery==0.3.1
docutils==0.16
sphinx-copybutton
Expand All @@ -17,6 +17,7 @@ awscli==1.16.35
flask
spacy==2.3.2
ray[tune]
sphinx-tabs==3.2.0

# PyTorch Theme
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
Expand Down