cirospat / newproject

cirospat pro-file
http://cirospat.readthedocs.io
Creative Commons Attribution 4.0 International
0 stars 2 forks source link

freccia "back to the top", come inserire lo script html nel file conf.py #1

Open cirospat opened 6 years ago

cirospat commented 6 years ago

i componenti dello script della freccia "back to the top" da far visualizzare sulle pagine html di read the docs sono qui qui: https://github.com/cirospat/newproject/tree/master/docs/top

la sintassi dello script è questa:

<!-- script Back To Top
-->
<a id='backTop'>Back To Top</a>
<script src="top/jquery.backTop.min.js"></script>
<script>
$(document).ready( function() 
$('#backTop').backTop({
'position' : 500,
'speed' : 500,
'color' : 'red',
});
});
</script>

.....

ma non so come inserire le istruzioni dello script "back to the top" sul file conf.py che è qui: https://github.com/cirospat/newproject/blob/master/docs/conf.py

cirospat commented 6 years ago

potrebbe essere qualcosa così da inserire nel conf.py:

setup(
packages=['top'],
package_data={'top': [
      '*.html',
      '*.css',
      '*.js',   
      '/img/*.png',
      '/img/*.db',
    ]},
include_package_data=True,
        ],
)
cirospat commented 6 years ago

o può darsi che bisogna inserire il codice nel file "theme_override.css" .... https://github.com/cirospat/newproject/blob/master/docs/static/theme_overrides.css ho provato ma non funziona, non viene visualizzata la freccia sulle pagine di Read the Docs

gbvitrano commented 6 years ago

Nel conf.py non devi aggiungere nulla per il back to top

Guarda il codice nel nostro repository https://github.com/gbvitrano/HfcQGIS/blob/master/_templates/layout.html, abbiamo cambiato un po le cose.


{% block extrahead %}
{{ super() }}
<!-- css back top -->
<!--<link href="../_static/jquerysctipttop.css" rel="stylesheet" type="text/css" />-->
<link href="{{ pathto("_static/jquerysctipttop.css", True) }}" rel="stylesheet" type="text/css" />
<!--<link href="../_static/backTop.css" rel="stylesheet" type="text/css" />-->
<link href="{{ pathto("_static/backTop.css", True) }}" rel="stylesheet" type="text/css" />
<!-- Script -->
<!--<script type="text/javascript" src="../_static/jquery.min.js"></script> -->
<script type="text/javascript" src="{{ pathto("_static/jquery.min.js", True) }}"></script> 
{% endblock %}```
gbvitrano commented 6 years ago

il footer è rimasto lo stesso


      {{ super() }}
       <!-- script Back To Top  -->
      <div class="footerc">
          <a id='backTop'>Back To Top</a>
 <!-- script toptoback automatico mobile/desktop -->  
 <!-- <script type="text/javascript" src="../_static/jquery.backTop.min.js"></script> -->
<script type="text/javascript" src="{{ pathto("_static/jquery.backTop.min.js", True) }}"></script>
<script>
            $(document).ready( function() {
                $('#backTop').backTop({
                    'position' : 400,
                    'speed' : 300,
                    'color' : 'red',

                                    });
            });
        </script>
      </div>

      <script>
            $(document).ready(function(){
                $('.csbuttons').cSButtons({total : #total","url" : "http://hfcqgis.opendatasicilia.it/it/latest/",});
            });
        </script>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<!-- INCOLLA QUI IL TUO CODICE -->
{% endblock %}```
cirospat commented 6 years ago

praticamente l'ho copiato di sana pianta e ora funziona